<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:80:"/www/wwwroot/crm.liunuo.net/public/../application/user/view/analysis/index.phtml";i:1552999926;s:60:"/www/wwwroot/crm.liunuo.net/application/user/view/base.phtml";i:1552999924;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title><?php echo config('website.site_name')?></title>
    <link rel="stylesheet" href="/static/libs/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/base.css">
    <link rel="stylesheet" href="/static/css/fonts.css">
    
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-black">
        <div class="layui-logo"><img src="/static/user/images/logo.png" class="head-logo"></div>
        <ul class="layui-nav layui-layout-left">
            <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$v): ?>
            <li class="layui-nav-item <?php if(isset($breadcrumb['0']) and $breadcrumb['0'] == $v['name']): ?>layui-this<?php endif; ?>">
                <a href="<?php echo \think\Request::instance()->root(true); ?>/<?php if(empty($v['url'])): ?><?php echo $v['children']['0']['url']; else: ?><?php echo $v['url']; endif; ?>"><i class="<?php echo $v['icon']; ?>"></i> <?php echo $v['name']; ?></a>
            </li>
            <?php endforeach; endif; else: echo "" ;endif; ?>
        </ul>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item"><a href="/" target="_blank"><i class="fa fa-home"></i> 网站首页</a></li>
            <?php $remind_sum= today_remind_sum();?>
            <li class="layui-nav-item" style="text-align: right;"><a href="/user/customer/remind/"><i class="fa fa-bell"></i> 提醒消息 <span class="layui-badge"><?php echo $remind_sum['count']; ?></span></a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="fa fa-user"></i> <?php if(session('user_auth.realname')): ?><?php echo session('user_auth.realname'); else: ?><?php echo session('user_auth.username'); endif; ?></a>
                <dl class="layui-nav-child">
                    <dd><a href="<?php echo url('user/index/editPassword'); ?>">修改密码</a></dd>
                    <dd><a href="<?php echo url('user/index/logout'); ?>">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <ul class="layui-nav layui-nav-tree">
                <li class="layui-nav-item"><a href="<?php echo url('user/index/index'); ?>"><i class="fa fa-home fa-fw"></i> 系统首页</a></li>
                <?php if(is_array($navbar) || $navbar instanceof \think\Collection || $navbar instanceof \think\Paginator): if( count($navbar)==0 ) : echo "" ;else: foreach($navbar as $key=>$n0): if(isset($n0['children']) and isset($breadcrumb['0']) and $breadcrumb['0'] == $n0['name']): if(is_array($n0['children']) || $n0['children'] instanceof \think\Collection || $n0['children'] instanceof \think\Paginator): if( count($n0['children'])==0 ) : echo "" ;else: foreach($n0['children'] as $key=>$n1): ?>
                <li class="layui-nav-item <?php if(isset($breadcrumb['1']) and $breadcrumb['1'] == $n1['name']): if(isset($n1['children'])): ?>layui-nav-itemed<?php else: ?>layui-this<?php endif; endif; ?>">
                    <a href="<?php if(isset($n1['children'])): ?>javascript:;<?php else: ?><?php echo \think\Request::instance()->root(true); ?>/<?php echo $n1['url']; endif; ?>"><i class="<?php echo $n1['icon']; ?> fa-fw"></i> <?php echo $n1['name']; ?></a>
                    <?php if(isset($n1['children'])): ?>
                    <dl class="layui-nav-child">
                        <?php if(is_array($n1['children']) || $n1['children'] instanceof \think\Collection || $n1['children'] instanceof \think\Paginator): if( count($n1['children'])==0 ) : echo "" ;else: foreach($n1['children'] as $key=>$n2): ?>
                        <dd<?php if(isset($breadcrumb['2']) and $breadcrumb['2'] == $n2['name']): ?> class="layui-this"<?php endif; ?>><a href="<?php echo \think\Request::instance()->root(true); ?>/<?php echo $n2['url']; ?>"><?php echo $n2['name']; ?></a></dd>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                    </dl>
                    <?php endif; ?>
                </li>
                <?php endforeach; endif; else: echo "" ;endif; endif; endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>
    </div>
    <div class="layui-breadcrumb">
        <?php if(isset($breadcrumb)): if(is_array($breadcrumb) || $breadcrumb instanceof \think\Collection || $breadcrumb instanceof \think\Paginator): if( count($breadcrumb)==0 ) : echo "" ;else: foreach($breadcrumb as $key=>$v): ?>
        <a><cite><?php echo $v; ?></cite></a>
        <?php endforeach; endif; else: echo "" ;endif; endif; ?>
    </div>
    <div class="layui-body">
        
<div class="layui-col-md12">
    <div class="layui-card">
      <div class="layui-card-body">
            <div class="layui-form">
                <div class="layui-form-item">
                    <form action="<?php echo url('user/analysis/index'); ?>" class="layui-form" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">时间范围</label>
                        <div class="layui-input-inline">
                            <input type="text" name="dateframe" class="layui-input" id="test-laydate-range-date" placeholder="<?php echo $dateframe; ?>">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <select name="type">
                            <option value="">统计类型</option>
                            <option value="1">新增客户</option>
                            <option value="2">新增回访（跟踪）</option>
                            <option value="3">新增提醒</option>
                            <option value="4">新增交易</option>
                        </select>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-primary ajax-search"><i class="fa fa-search"></i> 查看数据</button>
                    </div>
                    
                    <div class="layui-inline">
                        <label class="layui-form-label">快捷统计</label>
                        <a href="<?php echo url('user/customer/add'); ?>" class="layui-btn"><i class="fa fa-plus-circle"></i> 新增客户</a>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-row layui-col-space15">
    <!--访问量-->
    <style>
        .layuiadmin-big-font{font-size:66px;color:#666;text-align: center;line-height:36px;padding:5px 0 10px;overflow:hidden;text-overflow:ellipsis;word-break:break-all;white-space:nowrap}
        .layuiadmin-badge{font-size:36px;}
    </style>
    <div class="layui-col-md2">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="fa fa-user"></i> 客户总数据
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font">
                    <span class="layuiadmin-badge"><?php echo $data['all_customer']; ?></span> 
                </p>
            </div>
        </div>
    </div>
    <div class="layui-col-md2">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="fa fa-user"></i> 今日新增客户
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font">
                    <span class="layuiadmin-badge"><?php echo $data['today_customer']; ?></span> 
                </p>
            </div>
        </div>
    </div>
    <div class="layui-col-md2">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="fa fa-phone"></i> 总跟踪记录
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font">
                    <span class="layuiadmin-badge"><?php echo $data['all_track']; ?></span> 
                </p>
            </div>
        </div>
    </div>
    <div class="layui-col-md2">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="fa fa-phone"></i> 今日跟踪记录
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font">
                    <span class="layuiadmin-badge"><?php echo $data['today_track']; ?></span> 
                </p>
            </div>
        </div>
    </div>
    <div class="layui-col-md2">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="fa fa-comment"></i> 未处理提醒
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font">
                    <span class="layuiadmin-badge"><?php echo $data['remind_no']; ?></span> 
                </p>
            </div>
        </div>
    </div>
    <div class="layui-col-md2">
        <div class="layui-card">
            <div class="layui-card-header">
                <i class="fa fa-comment"></i> 已处理提醒
            </div>
            <div class="layui-card-body layuiadmin-card-list">
                <p class="layuiadmin-big-font">
                    <span class="layuiadmin-badge"><?php echo $data['remind_yes']; ?></span> 
                </p>
            </div>
        </div>
    </div>
    
    <div class="layui-col-md12">
        <div class="layui-card">
            <div class="layui-card-header"><?php echo $name; ?></div>
            <div class="layui-card-body">

                <div id="container" style="height: 400px;"></div>

            </div>
        </div>
    </div>
    
</div>

    </div>
</div>

<script src="/static/libs/layui/layui.all.js"></script>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/layui.base.js"></script>
<script src="/static/js/multiSelect.js"></script>
<script src="/static/js/common.js"></script>

<script src="/static/js/echarts.common.min.js"></script>  
<script type="text/javascript">
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    option = {
        title: {
            text: '<?php echo $dateframe; ?> - <?php echo $name; ?>',
            left: 'center'
        },
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        xAxis: {
            type: 'category',
            name: '日期',
            splitLine: {show: true},
            data: [
            <?php foreach ($array as $r) {?>
                '<?php echo $r; ?>',
            <?php }?>]
        },
        yAxis: {
            type: 'value'
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        series: [{
            name: '数量',
            data: [<?php foreach ($value as $r) {?>
                    <?php echo $r; ?>,
                    <?php }?>],
            type: 'line',
            label:{
                normal:{
                    show:true,
                    position:'top',
                    textStyle: {
                        color: '#333',
                        fontSize: 18
                    }
                }
            }
        }]
    };
    ;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
</script>
 <script src="/static/layuiadmin/layui/layui.js"></script> 
<script>
  layui.config({
    base: '/static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'laydate'], function(){
    var laydate = layui.laydate;
    
    //示例代码
    
    //日期范围
    laydate.render({
      elem: '#test-laydate-range-date'
      ,range: true
    });
  });
  </script>

<?php if($remind_sum['web'] > '0'): ?>
<script type="text/javascript">
    layer.msg('今日您有 <?php echo $remind_sum['count']; ?> 条信息待处理', {
            offset:'t',
            time: 5000, //不自动关闭
            btn: ['立即处理', '稍后处理'],
            yes: function(index){
                layer.close(index);
                window.location.href='/user/customer/remind/';
            }
        }
    );
</script>
<?php endif; ?>
</body>
</html>